package com.example.basic;

public class ThradYiled implements Runnable{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
        Thread.yield();
        System.out.println(Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        ThradYiled thradYiled = new ThradYiled();
        new Thread(thradYiled,"小红").start();
        new Thread(thradYiled,"小白").start();
    }
}
